//package com.watson.quartzdemo.job;
//
//import org.quartz.Job;
//import org.quartz.JobDetail;
//import org.quartz.JobExecutionContext;
//import org.quartz.JobExecutionException;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//public class EmailSenderJob implements Job {
//    private static Logger log = LoggerFactory.getLogger(EmailSenderJob.class);
//
//    @Override
//    public void execute(JobExecutionContext context) throws JobExecutionException {
//        //获取邮件发送对象
//        JobDetail jobDetail = context.getJobDetail();
//        EmailMessage ms = (EmailMessage) jobDetail.getJobDataMap().get("emailMessage");
//        MailSender mailSender = new MailSender();
//        try {
//            mailSender.sendEmail(ms);
//        } catch (EmailSendException e) {
//            log.error(e.toString());
//        }
//        log.info("send email success");
//
//    }
//
//
//}